<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
</head>
<body>
<div class="container">
    <div class="col-md-2 col-sm-5"></div>
    <div class="col-md-8 col-sm-5">
        <form action="" class="form-horizontal">
            <div class="form-group">
                <label for="username" class="control-label col-md-3">username</label>
                <div class="col-md-9">
                    <input type="text" class="form-control"
                           id="username" name="username" placeholder="username">
                </div>
            </div>
            <div class="form-group">
                <label for="password" class="control-label col-md-3">password</label>
                <div class="col-md-9">
                    <input type="password" class="form-control "
                           id="password" name="password" placeholder="password">
                </div>
            </div>
            <div class="form-group">
                <label for="email" class="control-label col-md-3">email</label>
                <div class="col-md-9">
                    <input type="email" class="form-control" name="email" id="email">
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-3 col-md-9">
                    <div class="radio radio-inline col-md-6 text-center">
                        <label for="raido" class="">
                            <input type="radio" name="city" value="123" id="raido">北京
                        </label>
                    </div>
                    <div class="radio radio-inline col-md-5 text-center">
                        <label for="radi" class="">
                            <input type="radio" name="city" value="124" id="radi">上海
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-md-offset-3 col-md-9">

                    <div class="checkbox checkbox-inline col-md-4">
                        <label for="check2">
                            <input type="checkbox" name="favourite" value="a" id="check2" checked>水果
                        </label>
                    </div>
                    <div class="checkbox checkbox-inline col-md-4">
                        <label for="check3">
                            <input type="checkbox" name="favourite" value="a" id="check3" checked>蔬菜
                        </label>
                    </div>
                    <div class="checkbox checkbox-inline col-md-3">
                        <label for="check4">
                            <input type="checkbox" name="favourite" value="a" id="check4" checked>主食
                        </label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="col-md-offset-3">
                    <select class="form-control" name="history">
                        <option value="1" >成吉思汗</option>
                        <option value="2" >秦始皇</option>
                        <option value="3">努尔哈赤</option>
                        <option value="4" selected  > 完颜阿骨打</option>
                    </select>
                </div>
            </div>
            <div class="row">
                <div class="col-md-offset-3 col-md-9">
                    <div class="row">
                        <button class="btn btn-info col-md-2 col-md-offset-2" value="submit" type="submit">submit</button>
                        <button class="btn-primary btn col-md-2 col-md-offset-2" value="resit" type="reset">reset</button>
                        <button class="btn btn-default col-md-2 col-md-offset-2" value="" type="button">button</button>
                    </div>

                </div>
            </div>


        </form>
    </div>
    <div class="col-md-2 col-sm-2"></div>
</div>


<script type="text/javascript" src="bootstrap/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<script type="text/javascript">
    $("input:text").val("input:text 设置text值")//把所有单行文本框都赋值

//    $("input[type='text']").val("input[name='text']")//好用
    $("input:password").val("input:password设置password值")
    $("input:radio").attr("checked","checked")//radio增加选中 属性。
    $("input:checkbox").removeAttr("checked")//移除原来定义的选中状态
    $("option:selected").removeAttr("selected");//记得这个是selected是option的属性。

</script>

</body>
</html>